package base 
{
	import flash.display.Sprite;
	
	public class GPoint extends Sprite
	{
		
		
		public function get_x():Number
		{
			return x;
		}
		
		public function get_y():Number
		{
			return y;
		}
		
		public function set_x(dx:Number):void
		{
			x = dx;
		}
		
		public function set_y(dy:Number):void
		{
			y = dy;
		}	
		
		public static function degrees(radians:Number):Number
		{
			return radians * (180 / Math.PI);
		}
		
		public function angleX():Number
		{
			return Math.cos( angle());
		}
		
		public function angleY():Number
		{
			return Math.sin(angle());
		}
		
		public function angle():Number
		{
			return Math.atan2(y, x);
		}
		
		public function distance(other:GPoint):Number
		{
			return Math.sqrt( ((x - other.x)*(x - other.x)) + ((y - other.y)*(y - other.y)));
		}
		
		public function GPoint(dx:Number = 0, dy:Number = 0)
		{
			x = dx;
			y = dy;
		}
	}
}